package cn.mulanbay.schedule.domain;

import cn.mulanbay.schedule.enums.JobExecuteResult;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;

import java.io.Serializable;
import java.util.Date;

/**
 *
 * @author fenghong
 * @create 2022-01-16 10:00
 */
@TableName("task_log")
public class TaskLog implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    private Long taskTriggerId;

    /**
     * 调度触发器
     */
    @TableField(exist = false)
    private TaskTrigger taskTrigger;
    /**
     * 运营日
     */
    @JsonFormat(pattern = "yyyy-MM-dd",timezone="GMT+8")
    private Date bussDate;
    /**
     * 调度唯一编号
     */
    private String scheduleIdentityId;
    /**
     * 调度执行开始时间
     */
    private Date startTime;
    /**
     * 调度执行结束时间
     */
    private Date endTime;
    /**
     * 花费时间（毫秒）
     */
    private Long costTime;

    private JobExecuteResult executeResult;

    private String subTaskExecuteResults;
    /**
     * 部署点
     */
    private String deployId;
    private String ipAddress;
    /**
     * 重做次数
     */
    private Integer redoTimes;

    /**
     * 最后一次重做开始时间
     */
    private Date lastStartTime;
    /**
     * 最后一次重做结束时间
     */
    private Date lastEndTime;

    private String logComment;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }
    public Long getTaskTriggerId() {
        return taskTriggerId;
    }

    public void setTaskTriggerId(Long taskTriggerId) {
        this.taskTriggerId = taskTriggerId;
    }

    public TaskTrigger getTaskTrigger() {
        return taskTrigger;
    }

    public void setTaskTrigger(TaskTrigger taskTrigger) {
        this.taskTrigger = taskTrigger;
    }

    public Date getBussDate() {
        return bussDate;
    }

    public void setBussDate(Date bussDate) {
        this.bussDate = bussDate;
    }
    public String getScheduleIdentityId() {
        return scheduleIdentityId;
    }

    public void setScheduleIdentityId(String scheduleIdentityId) {
        this.scheduleIdentityId = scheduleIdentityId;
    }
    public Date getStartTime() {
        return startTime;
    }

    public void setStartTime(Date startTime) {
        this.startTime = startTime;
    }
    public Date getEndTime() {
        return endTime;
    }

    public void setEndTime(Date endTime) {
        this.endTime = endTime;
    }
    public Long getCostTime() {
        return costTime;
    }

    public void setCostTime(Long costTime) {
        this.costTime = costTime;
    }
    public JobExecuteResult getExecuteResult() {
        return executeResult;
    }

    public void setExecuteResult(JobExecuteResult executeResult) {
        this.executeResult = executeResult;
    }
    public String getSubTaskExecuteResults() {
        return subTaskExecuteResults;
    }

    public void setSubTaskExecuteResults(String subTaskExecuteResults) {
        this.subTaskExecuteResults = subTaskExecuteResults;
    }
    public String getDeployId() {
        return deployId;
    }

    public void setDeployId(String deployId) {
        this.deployId = deployId;
    }
    public String getIpAddress() {
        return ipAddress;
    }

    public void setIpAddress(String ipAddress) {
        this.ipAddress = ipAddress;
    }
    public Integer getRedoTimes() {
        return redoTimes;
    }

    public void setRedoTimes(Integer redoTimes) {
        this.redoTimes = redoTimes;
    }
    public Date getLastStartTime() {
        return lastStartTime;
    }

    public void setLastStartTime(Date lastStartTime) {
        this.lastStartTime = lastStartTime;
    }
    public Date getLastEndTime() {
        return lastEndTime;
    }

    public void setLastEndTime(Date lastEndTime) {
        this.lastEndTime = lastEndTime;
    }
    public String getLogComment() {
        return logComment;
    }

    public void setLogComment(String logComment) {
        this.logComment = logComment;
    }

    @Override
    public String toString() {
        return "TaskLog{" +
            "id=" + id +
            ", taskTriggerId=" + taskTriggerId +
            ", bussDate=" + bussDate +
            ", scheduleIdentityId=" + scheduleIdentityId +
            ", startTime=" + startTime +
            ", endTime=" + endTime +
            ", costTime=" + costTime +
            ", executeResult=" + executeResult +
            ", subTaskExecuteResults=" + subTaskExecuteResults +
            ", deployId=" + deployId +
            ", ipAddress=" + ipAddress +
            ", redoTimes=" + redoTimes +
            ", lastStartTime=" + lastStartTime +
            ", lastEndTime=" + lastEndTime +
            ", logComment=" + logComment +
        "}";
    }
}
